import * as chatTypes from "../Types/ChatTypes"
const actionCreator = (type, payload) => ({
    type,
    payload
})


//添加聊天记录
//定义action 本质就是一个对象 复用上面的actionCreator 来创建action对象
export const addChatLog = chatLog => actionCreator(chatTypes.ADD_CHAT, chatLog) //增加聊天记录


export const changeStatus = actionCreator(chatTypes.CHANGE_STATUS) //变更登入状态


export const changeUsername = username => actionCreator(chatTypes.CHANGE_USERNAME, username)//变更用户名